package com.zhuoyue.biz.core.command.cmd.common;

import com.alibaba.fastjson.JSON;
import com.zhuoyue.biz.core.api.dto.req.ControlReq;

/**
 * @author wjming
 * @ClassName: CmdUtil
 * @Description: cmd工具
 * @Date 2021-07-08 17:47
 */
public class CmdUtil {
    private static final String DELAY_TIME = "delayTime";

    public static int getDelayTime(ControlReq controlReq) {
        try {
            if (controlReq != null && controlReq.getActions() != null && controlReq.getActions().get(DELAY_TIME) != null && controlReq.getActions().get(DELAY_TIME) != "") {
                return (int) controlReq.getActions().get("delayTime");
            }
        } catch (Exception e) {
            System.out.println("action参数错误: " + JSON.toJSONString(controlReq.getActions()));
            return 0;
        }
        return 0;
    }
}
